// import wx from 'wx'
var Fly = require('flyio/dist/npm/wx')

const request = new Fly()
console.log(request)
request.interceptors.request.use(async(request) => {
  let Token = store.state.userTolen
  console.log(Token)
})

request.interceptors.response.use(
  (response, promise) => {
    wx.hideNavigationBarLoading()
    return promise.resolve(response.data)
  },
  (err, promise) => {
    wx.hideNavigationBarLoading()
    wx.showToast({
      title: err.message,
      icon: 'none'
    })
    return promise.resolve()
  }
)

export default request
